<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
 <head>
  <title><?php echo $this->_lang['list']; ?> - <?php echo $this->_lang['site_title']; ?></title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link href="<?php echo $_config['url']['css']; ?>base.css" rel="stylesheet" type="text/css">
  <script type="text/javascript">
  <!--
	function check_form()
	{
		var f = document.getElementById('f1');
		if( f.site.value == '' )
		{
			alert('<?php echo $this->_lang['website_name_not_empty']; ?>');
			f.site.focus();
			return false;
		}

		if( f.url.value == '' )
		{
			alert('<?php echo $this->_lang['website_url_not_empty']; ?>');
			f.url.focus();
			return false;
		}

		f.submit.disabled = true;
		return true;
	}

  //-->
  </script>
 </head>

 <body>
 <div id="mask">
<?php echo $layout_header; ?>
<div style="margin:0 auto;width:650px;padding-top:25px;">
 <fieldset style="width:100%; border:1px solid #A5A5A5;text-align:left;font-size:12px;font-family:Verdana;padding:15px;">
 <legend style="color:#A5A5A5;font-size:16px;"><?php echo $this->_lang['list']; ?></legend>

<table border="0" align="center" cellpadding="0" cellspacing="0" width="100%">
<tr>
		<td style="background-color:#CCCCCC"><table id="innerTable" border="0" width="100%" align="center" cellpadding="5" cellspacing="1">
	<tr>
		<td width="70" style="background-color:#FFFFFF;" colspan="4"><a href="site_add.php<?php echo isset($data['uri']) ? '?uri='.$data['uri'] : ''; ?>"><?php echo $this->_lang['add']; ?></a></td>
	</tr>
	<tr>
		<td width="100" style="background-color:#FFFFFF;"><?php echo $this->_lang['name']; ?></td>
		<td style="background-color:#FFFFFF;"><?php echo $this->_lang['website_url']; ?></td>
		<td style="background-color:#FFFFFF;"><?php echo $this->_lang['cate']; ?></td>
		<td style="background-color:#FFFFFF;"><?php echo $this->_lang['operate']; ?></td>
	</tr>
	<?php
	foreach($data['row'] as $site )
	{
	?>
	<tr>
		<td style="background-color:#FFFFFF;"><?php echo $site['name']; ?></td>
		<td style="background-color:#FFFFFF;"><a href="<?php echo $site['url']; ?>" target="_blank"><?php echo $site['url']; ?></a></td>
		<td style="background-color:#FFFFFF;"><?php echo $site['cname']; ?></td>
		<td style="background-color:#FFFFFF;"><a href="site_modify.php?id=<?php echo $site['id']; ?>"><?php echo $this->_lang['edit']; ?></a> <a href="#" onClick="javascript:if( window.confirm('<?php echo $this->_lang['confirm_delete']; ?>') ) window.location='site_delete.php?id=<?php echo $site['id']; ?>';"><?php echo $this->_lang['delete']; ?></a></td>
	</tr>
	<?php
	}
	?>
	<tr><td colspan="5" style="background-color:#FFFFFF;" align="center"><?php
	if( ! isset($_GET['page']) ) $_GET['page'] = 1;
	$pagestr = $this->_lang['page'] . $this->_lang['colon'];
	for($i=1; $i<=$data['total_page']; $i++)
	{
		if( $i == $_GET['page'] )
		{
			$pagestr .= ' ' . $i . ' ';
		}else{
			$pagestr .= ' <a href="site_list.php?page='. $i . '">' . $i . '</a> ';
		}
	}
	if( $data['total_page'] > 1 )
	{
		echo $pagestr;
	}
	?></td></tr>
</table>
</td>
	</tr>
</table>
</fieldset>
</div>

<?php echo $layout_footer; ?>
</div>
</body>
</html>
